﻿

@{
    ViewBag.Title = "意向历史";
}


@model System.Collections.IEnumerable
<script type="text/javascript">
    function OnClick(s, e) {
        var actionParams = $("form").attr("action").split("?filterString=");
        actionParams[1] = GridView2.cpGridFilterExpression;
        $("form").attr("action", actionParams.join("?filterString="));
    }
        function UpdateGridHeight() {
            GridView2.SetHeight(0);
            var containerHeight = ASPxClientUtils.GetDocumentClientHeight();
            if (document.body.scrollHeight > containerHeight)
                containerHeight = document.body.scrollHeight;
            GridView2.SetHeight(containerHeight-150);
        }

        window.addEventListener('resize', function(evt) {
            if(!ASPxClientUtils.androidPlatform)
                return;
            var activeElement = document.activeElement;
            if(activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA") && activeElement.scrollIntoViewIfNeeded)
                window.setTimeout(function() { activeElement.scrollIntoViewIfNeeded(); }, 0);
        });
</script>

@using (Html.BeginForm(new { Controller = "Home", Action = "ExportToPOsHis" }))
{
    @Html.DevExpress().Button(settings =>
{
    settings.Name = "btnExport";
    settings.Text = "导出表格";
    settings.ClientSideEvents.Click = "OnClick";
    settings.UseSubmitBehavior = true;
}).GetHtml()
}
<div>
    @Html.Partial("_POSugPartialHis", Model)
</div>
<script type="text/javascript">
        ASPxClientControl.GetControlCollection().ControlsInitialized.AddHandler(function (s, e) {
            UpdateGridHeight();
        });
        ASPxClientControl.GetControlCollection().BrowserWindowResized.AddHandler(function (s, e) {
            UpdateGridHeight();
        });
</script>
